#ifndef ABSUI_SELECTION_VIEW_HPP
#define ABSUI_SELECTION_VIEW_HPP

#include "AbsUI/CommonUIConfig.hpp"
#include <boost/signals/trackable.hpp>

namespace Ctrl { class SelectionModel; }

namespace AbsUI
{

/// \ingroup AbsUI
/// \brief It provides the interface that the a view needing selection change notification should implement.
class COMMON_UI_API SelectionView: boost::signals::trackable
{
public:
	/// \brief It bounds the view to the signals provided by the selection model.
	SelectionView( Ctrl::SelectionModel& rSelectionModel);

	/// \brief It executes the logic when the selection was changed.
	virtual void changeSelection( const Ctrl::SelectionModel& ) = 0;

protected:
	Ctrl::SelectionModel& rSelectionModel_;

private:
	/// \brief It is called when the selection model changes (bound to the corresponding signal). It calls the virtual 
	///		method changeSelection( Ctrl::SelectionModel& ) to perform the logic on this notification.
	void handleChangeSelection( const Ctrl::SelectionModel&);
};


} // namespace AbsUI

#endif // ABSUI_SELECTION_VIEW_HPP